home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-02-19 | 9.8 KB | 472 lines | [mlts/slnk] |
- ! AWARE PowerFax 5
- ! Olivier Hamonnière for Apple Computer France
- ! Version : 1.1
- ! Date : April 29, 1994
- !
- !
- ! 'mlts' resource info for this modem:
- ! byte 1 == 01 -> modem HAS built-in reliability protocols
- ! byte 2 == 00 -> reserved by Apple
- ! byte 3 == 32 -> max hex chars in varstr 7 (50 dec)
- ! byte 4 == 32 -> max hex chars in varstr 8 (50 dec)
- ! byte 5 == 32 -> max hex chars in varstr 9 (50 dec)
- !
- !
- @ORIGINATE
- @ANSWER
- !
- !-------------------------------------------------------------------------------
- ! Set up the modem - label range is 1-10
- !-------------------------------------------------------------------------------
- !
- ! Mac talks to the modem at 19,200 bps.
- SerReset 19200, 0, 8, 1
- DTRset
- !
- ! Reset the serial port handshake options
- HSReset 0 0 0 0 0 0
- !
- SetTries 0
- @LABEL 1
- flush
- matchclr
- matchstr 1 3 "OK\13\10"
- !
- ! &F - Recall factory settings
- ! E0 - Turn command echo off
- ! W1 - Enable detailed error correction messages (protocol,speed,DTE speed)?
- ! &K3 - Enable RTS/CTS flow control
- ! &M0 - Asynchronous mode
- ! &Q6 - Normal mode, asynchronous mode
- ! &T5 - Disable remote test requests
- ! \J0 - Disable adjustment of DTE speed to line speed
- ! \K4 - On local break, switch to command mode
- ! \N0 - Enable normal mode (disable error correction)
- ! %C0 - Disable data compression
- ! -K0 - Disable protocol conversion (V42 LAPM to MNP10)
- ! S0=0 - Don't answer calls
- ! All other relevant parameters set by the AT&F command (see manual)
- !
- write "AT&F&D0E0W1&K3&M0&Q6&T5\\J0\\K4\\N0%C0-K0S0=0\13"
- matchread 30
- inctries
- iftries 2 71
- ! Modem not responding, send long break.
- LBreak
- jump 1
- !
- @LABEL 3
- ! Modem responding & configured.
- ! Determine if reliable link is requested.
- !
- ! If modem mnp10 link requested (var 4 == 2) then jump label 4
- ! If modem v42 link requested (var 4 == 1) then jump label 5
- ! If no modem v42 link requested (var 4 == 0) [same as ARA 1.0] then jump label 9
- !
- ifstr 4 4 "2"
- ifstr 4 5 "1"
- ifstr 4 9 "0"
- !
- ! Else invalid value in var 4, exit with error
- jump 76
- !
- @LABEL 4
- ! MNP10 link is requested. Enable MNP10 protocol
- matchclr
- matchstr 1 7 "OK\13\10"
- ! )M1 - Enable power level adjustment of cellular communications
- write "AT\\N3-K1)M1*H0\13"
- matchread 30
- jump 71
- !
- @LABEL 5
- ! Reliable link is requested. OK for LAP-M -> MNP 4.
- matchclr
- matchstr 1 7 "OK\13\10"
- ! \N3 - Enable both MNP and V42 as well as normal mode
- write "AT\\N3\13"
- matchread 30
- jump 71
- !
- @LABEL 7
- ! If we DID support v42b in the modem, this is where it would go.
- !
- @LABEL 9
- ! If speaker on flag is true, jump to label 13. Else turn off the speaker.
- ifstr 2 13 "1"
- pause 5
- matchclr
- matchstr 1 13 "OK\13\10"
- write "ATM0\13"
- matchread 30
- jump 71
- !
- !
- !
- ! Modem ready, so enable answer or dial mode - label range is 11-30
- ! Determine if answer or originate mode.
- !
- @LABEL 13
- pause 5
- ifANSWER 62
- !
- !-------------------------------------------------------------------------------
- ! Here is ORIGINATE mode. - Dialing
- !-------------------------------------------------------------------------------
- !
- ! Dial type dispatch
- !
- ! Normal dialing (parm 6 == 0) jump to 19
- ! Blind dialing (parm 6 == 1) jump to 17
- ! Manual dialing (parm 6 == 2) jump to 15
- !
- ifstr 6 19 "0"
- ifstr 6 17 "1"
- ifstr 6 15 "2"
- !
- ! Else invalid value in var 6, exit with error
- jump 76
- !
- !
- ! Manual dialing is done here
- @label 15
- note "Appel manuel . . ." 3
- write "ATD\13"
- jump 32
- !
- !
- ! Blind dialing is done here
- @label 17
- matchclr
- matchstr 1 19 "OK\13\10"
- write "ATX1\13"
- matchread 30
- jump 71
- !
- !
- ! This is where we break up long dialstrings.
- ! This modem has a 50 chars command buffer for dialing
- ! Labels 19 - 27 reserved.
- !
- @label 19
- ! Parameter 1 contains the full dialstring from the connection document.
- ! Parameter 3 contains "P" for pulse & "T" for tone dialing.
- ! Parameter 7, 8 & 9 contain the dial string fragments.
- !
- note "Appel en cours : ^1" 3
- !
- ! If parm 8 is blank goto sending parm 7 only
- ! else send parm 7 with semicolon
- ifstr 8 25 " "
- !
- matchclr
- matchstr 1 21 "OK\13\10"
- matchstr 2 72 "NO DIALTONE\13\10"
- matchstr 3 74 "BUSY\13\10"
- matchstr 4 73 "ERROR\13\10"
- matchstr 5 77 "DELAYED"
- matchstr 6 79 "BLACKLISTED\13\10"
- write "ATD^3^7;\13"
- matchread 400
- jump 71
- !
- ! If parm 9 is blank goto sending param 8
- ! else send param 8 with semicolon & param 9
- @label 21
- ifstr 9 27 " "
- !
- matchclr
- matchstr 1 23 "OK\13\10"
- matchstr 2 72 "NO DIALTONE\13\10"
- matchstr 3 74 "BUSY\13\10"
- matchstr 4 73 "ERROR\13\10"
- matchstr 5 77 "DELAYED"
- matchstr 6 79 "BLACKLISTED\13\10"
- write "ATD^3^8;\13"
- matchread 400
- jump 71
- !
- ! Send final parameter string then wait for connect message.
- !
- @label 23
- write "ATD^3^9\13"
- jump 32
- !
- @label 25
- write "ATD^3^7\13"
- jump 32
- !
- @label 27
- write "ATD^3^8\13"
- jump 32
- !
- !
- !-------------------------------------------------------------------------------
- ! Connecting - label range is 31-60
- !-------------------------------------------------------------------------------
- !
- @LABEL 32
- matchclr
- matchstr 1 68 "RING\13\10"
- matchstr 2 72 "NO DIALTONE\13\10"
- matchstr 3 73 "NO CARRIER\13\10"
- matchstr 4 73 "ERROR\13\10"
- matchstr 5 74 "BUSY\13\10"
- matchstr 6 75 "NO ANSWER\13\10"
- matchstr 7 77 "DELAYED"
- matchstr 8 79 "BLACKLISTED\13\10"
- !
- matchstr 11 34 "CONNECT 2400\13\10"
- matchstr 12 35 "CONNECT 4800\13\10"
- matchstr 13 36 "CONNECT 7200\13\10"
- matchstr 14 37 "CONNECT 9600\13\10"
- matchstr 15 38 "CONNECT 12000\13\10"
- matchstr 16 39 "CONNECT 14400\13\10"
- !
- matchstr 17 40 "CARRIER 2400\13\10"
- matchstr 18 41 "CARRIER 4800\13\10"
- matchstr 19 42 "CARRIER 7200\13\10"
- matchstr 20 43 "CARRIER 9600\13\10"
- matchstr 21 44 "CARRIER 12000\13\10"
- matchstr 22 45 "CARRIER 14400\13\10"
- !
- matchstr 23 46 "PROTOCOL: LAP-M\13\10"
- matchstr 24 47 "PROTOCOL: ALT\13\10"
- matchstr 25 48 "PROTOCOL: ALT - CELLULAR\13\10"
- matchstr 26 32 "PROTOCOL: NONE\13\10"
- !
- matchread 700
- ! If in ANSWER mode, loop back.
- ! Else in ORIGINATE mode, the modem has timed out.
- ifANSWER 32
- jump 71
- !
- !
- ! This modem HAS been setup to do CTS handshaking
- ! and we assume that a CTS handshaking cable is being used.
- !
- @LABEL 34
- note "Modems connectés à 2400 bps." 2
- CommunicatingAt 2400
- jump 58
- !
- @LABEL 35
- note "Modems connectés à 4800 bps." 2
- CommunicatingAt 4800
- jump 58
- !
- @LABEL 36
- note "Modems connectés à 7200 bps." 2
- CommunicatingAt 7200
- jump 58
- !
- @LABEL 37
- note "Modems connectés à 9600 bps." 2
- CommunicatingAt 9600
- jump 58
- !
- @LABEL 38
- note "Modems connectés à 12000 bps." 2
- CommunicatingAt 12000
- jump 58
- !
- @LABEL 39
- note "Modems connectés à 14400 bps." 2
- CommunicatingAt 14400
- jump 58
- !
- !
- ! Carrier connections
- !
- @LABEL 40
- note "Porteuse détectée à 2400 bps." 2
- jump 32
- !
- @LABEL 41
- note "Porteuse détectée à 4800 bps." 2
- jump 32
- !
- @LABEL 42
- note "Porteuse détectée à 7200 bps." 2
- jump 32
- !
- @LABEL 43
- note "Porteuse détectée à 9600 bps." 2
- jump 32
- !
- @LABEL 44
- note "Porteuse détectée à 12000 bps." 2
- jump 32
- !
- @LABEL 45
- note "Porteuse détectée à 14400 bps." 2
- jump 32
- !
- !
- ! V.42 and MNP4 link connections
- ! Tell ARA with USERHOOK 2 that a reliable modem link has been established.
- !
- @LABEL 46
- note "Liaison LAP-M fiabilisée négociée." 3
- userhook 2
- pause 20
- jump 32
- !
- @LABEL 47
- note "Liaison MNP fiabilisée négociée." 3
- userhook 2
- pause 20
- jump 32
- !
- !
- ! MNP10 link connections
- ! Tell ARA with USERHOOK 4 that an MNP10 modem link has been established.
- !
- @LABEL 48
- note "Liaison MNP10 négociée." 3
- userhook 4
- pause 20
- jump 32
- !
- !
- @LABEL 58
- ! set the serial port handshake options for CTS
- HSReset 0 1 0 0 0 0
- !
- !
- ! Connection established. In ORIGINATE mode pause before exit.
- !
- ifANSWER 59
- pause 30
- @LABEL 59
- exit 0
- !
- !
- !
- !-------------------------------------------------------------------------------
- ! Here is ANSWER mode initialization part
- !-------------------------------------------------------------------------------
- !
- ! @ANSWER
- ! Set the modem to answer on 2nd ring - label range is 61-70
- !
- @LABEL 62
- matchclr
- ! On match jump to MODEM STATUS and wait for RING
- matchstr 1 32 "OK\13\10"
- write "ATS0=2\\N3-K1)M1*H0\13"
- matchread 30
- jump 71
- !
- ! RING entry point
- ! If ORIGINATE mode return to waiting for input.
- ! Else claim the serial port and return.
- !
- @LABEL 68
- ifORIGINATE 32
- userhook 1
- note "Réponse en cours . . ." 2
- jump 32
- !
- !
- !
- !-------------------------------------------------------------------------------
- ! Error messages - label range is 71-100
- !-------------------------------------------------------------------------------
- !
- ! Modem Not Responding
- @LABEL 71
- exit -6019
- !
- ! No Dialtone
- @LABEL 72
- exit -6020
- !
- ! No Carrier or Error
- @LABEL 73
- exit -6021
- !
- ! Busy
- @LABEL 74
- exit -6022
- !
- ! No Answer
- @LABEL 75
- exit -6023
- !
- ! Invalid Varstring Value
- @LABEL 76
- exit -6027
- !
- ! Delayed Number (blacklisted)
- @LABEL 77
- exit -6002 "Numéro momentanément interdit."
- !
- ! Number forbidden (blacklisted)
- @LABEL 78
- exit -6002 "Numéro définitivement interdit.\13Réinitialisez le modem pour réutiliser ce numéro."
- !
- ! Blacklist full
- @LABEL 79
- exit -6002 "La liste des numéros interdits est pleine.\13Réinitialisez le modem."
- !
- ! Abort
- @LABEL 80
- exit -6002 "Abandon de l'action en cours."
- !
- !
- !
- !-------------------------------------------------------------------------------
- ! Hang up the modem - label range is 101-120
- !-------------------------------------------------------------------------------
- !
- @HANGUP
- !
- @LABEL 102
- flush
- SerReset 19200,0,8,1
- settries 0
- HSReset 0 0 0 0 0 0
- !
- @LABEL 105
- ! Drop the modem into command mode with escape sequence.
- ! Then tell modem to hangup.
- ! Repeat hangup command and escape sequence 3 times max.
- !
- flush
- matchclr
- matchstr 1 108 "OK\13\10"
- pause 10
- write "+++"
- matchread 15
- !
- @LABEL 108
- matchclr
- matchstr 1 111 "NO CARRIER\13\10"
- matchstr 2 111 "OK\13\10"
- matchstr 3 111 "ERROR\13\10"
- write "ATH0\13"
- matchread 30
- inctries
- iftries 3 71
- DTRClear
- jump 105
- !
- ! recall the factory setting.
- !
- @LABEL 111
- SerReset 19200,0,8,1
- matchclr
- matchstr 1 114 "OK\13\10"
- write "AT&F\13"
- matchread 30
- jump 71
- !
- @LABEL 114
- DTRset
- exit 0
- !
- !-------------------------------------------------------------------------------
- !
- ! Labels 121-128 are reserved for future emergency hacks.
- !